# -*- coding: utf-8 -*-
# @Time : 2022/4/9 21:42
# @Author : Liuqing
# @File : 23_回文.py
# @Software : PyCharm
from re import sub


def palindrome(string):
    s = sub(r'[\W_]', '', string.lower())
    return s == s[::-1]


if __name__ == '__main__':
    print(palindrome('taco cat'))
    print(palindrome('tacocat'))
